window.creatrPrefab = function(pfName){
    if(pfName == null || pfName == undefined)return;
    let prefabName = cc.instantiate(pfName);
    if(prefabName)return prefabName
};

window.removeNodeByParent = function(remove){
    remove.removeFromParent();
};

var levelData = null;
window.setLevelData = function(data){
    levelData = data;
    let maxLevel = window.gameConfig.getGameConfigData("level");
    if(maxLevel < data.levelNumber)
    {
       window.gameConfig.saveLevel(data.levelNumber);
    }
    
};

window.getLevelData = function(){
    return levelData;
};

window.gameType = "play";

//加载图片资源
window.onLoadSpriteRes = function(url, type, callback, self){
    cc.loader.loadRes("image/" + url, type, function (err, spriteFrame) {
        if(err == null)
        {
            callback(spriteFrame, self);
        }
    });
};